function findNumberIn2DArray(matrix: number[][], target: number): boolean {
    if (matrix.length === 0 || matrix[0].length === 0) {
        return false
    }
    const row = matrix.length;
    const col = matrix[0].length;
    let m = 0;
    let n = col -1;
    while (m < row && n >= 0) {
        if (matrix[m][n] === target) {
            return true;
        }

        if (matrix[m][n] > target) {
            n--;
        } else {
            m++;
        }
    }
    return false;
};